﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using MyLocalChurch.Constants;
using MyLocalChurch.Models.Resources;

namespace MyLocalChurch.Models
{
    public class ChurchService : ATracker
    {
        public int Id { get; set; }

        [Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorMessages)), DataType(DataType.Text)]
        public DayOfWeek DayOfWeek { get; set; }

        [RegularExpression(SystemConstants.TimeFormatRegex, ErrorMessageResourceName = "Invalid", ErrorMessageResourceType = typeof(ErrorMessages))]
        public string StartTime { get; set; }

        [StringLength(100)]
        public string Description { get; set; }

        public ChurchService()
        {
            IsActive = true;
        }

        public override string ToString()
        {
            return StartTime ?? base.ToString();
        }
    }
}